/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.util.Objects;

/**
 *
 * @author Оксана
 */
public class Test {
    private Integer id;
    private int quests, variants;
    private Subject subject;
    private Person tutor;

    public Test() {
    }

    public Test(Integer id, int quests, int variants, Subject subject, Person tutor) {
        this.id = id;
        this.quests = quests;
        this.variants = variants;
        this.subject = subject;
        this.tutor = tutor;
    }   
    
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getQuests() {
        return quests;
    }

    public void setQuests(int quests) {
        this.quests = quests;
    }

    public int getVariants() {
        return variants;
    }

    public void setVariants(int variants) {
        this.variants = variants;
    }

    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }

    public Person getTutor() {
        return tutor;
    }

    public void setTutor(Person tutor) {
        this.tutor = tutor;
    }   

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Test other = (Test) obj;
        if (this.id != other.id) {
            return false;
        }
        if (this.quests != other.quests) {
            return false;
        }
        if (this.variants != other.variants) {
            return false;
        }
        if (!Objects.equals(this.subject.getId(), other.subject.getId())) {
            return false;
        }
        if (!Objects.equals(this.tutor.getId(), other.tutor.getId())) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 43 * hash + Objects.hashCode(this.id);
        hash = 43 * hash + this.quests;
        hash = 43 * hash + this.variants;
        hash = 43 * hash + Objects.hashCode(this.subject);
        hash = 43 * hash + Objects.hashCode(this.tutor);
        return hash;
    }
}